﻿using Hotel.DAL;
using Hotel.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hotel.BLL
{
    public class HouseTypeBLL
    {
        public HouseTypeBLL(HouseTypeDAL houseTypeDAL) 
        {
            HouseTypeDAL = houseTypeDAL;
        }

        public HouseTypeDAL HouseTypeDAL { get; }





        /// <summary>
        /// 房型添加
        /// </summary>
        /// <param name="houseTypeModel"></param>
        /// <returns></returns>
        public int HouseTypeAdd(HouseTypeModel houseTypeModel)
        {


            return HouseTypeDAL.HouseTypeAdd(houseTypeModel);
        }




        /// <summary>
        /// 房型显示
        /// </summary>
        /// <param name="count"></param>
        /// <param name="page"></param>
        /// <param name="HouseTypeName"></param>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>

        public List<HouseTypeModel> HouseTypeList(out int count, out int page, string? HouseTypeName, int index = 1, int size = 2)
        {
        
            return HouseTypeDAL.HouseTypeList(out count, out page, HouseTypeName, index, size); 

        }




        /// <summary>
        /// 房型删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int HouseTypeDel(int id)
        {
            return HouseTypeDAL.HouseTypeDel(id);
        }





        ///-----------------------------------------------------------------------------------------------------

        /// <summary>
        /// 房号添加
        /// </summary>
        /// <param name="houseNoModel"></param>
        /// <returns></returns>
        public int HouseNoAdd(HouseNoModel houseNoModel)
        {

            
            return HouseTypeDAL.HouseNoAdd(houseNoModel);

        }




        /// <summary>
        /// 房号显示
        /// </summary>
        /// <returns></returns>
        public List<HouseNoModel> HouseNoList()
        {
            return HouseTypeDAL.HouseNoList();
        }




        /// <summary>
        ///房号反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public HouseNoModel HouseNoAll(int id)
        {
            return HouseTypeDAL.HouseNoAll(id);
        }





        /// <summary>
        /// 房号修改
        /// </summary>
        /// <param name="HouseNoModel"></param>
        /// <returns></returns>
        public int HouseNoUpd(HouseNoModel HouseNoModel)
        {
         
            return HouseTypeDAL.HouseNoUpd(HouseNoModel);   
        }





        /// <summary>
        /// 批量修改
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="State"></param>
        /// <returns></returns>
        public int HouseNoState(string ids, int State)
        {

            var  res= HouseTypeDAL.HouseNoState(ids, State);
            if (res > 0)
            {

                return 1;//成功
            }
            else 
            {
                return 2;//失败
            
            }


        }

















    }
}
